package com.zheng.durid;

import com.zheng.zk.Curator;
import org.apache.curator.framework.CuratorFramework;
import org.apache.zookeeper.CreateMode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DuridApplication {

    public static void main(String[] args) throws Exception {
        CuratorFramework curatorFramework= Curator.getCuratorFramework();
        if(curatorFramework.checkExists().forPath("/mysqlConfig")==null){
            curatorFramework.create().withMode(CreateMode.EPHEMERAL).forPath("/mysqlConfig","jdbc:mysql://localhost:3306/zk01,root,123456".getBytes());
        }
        SpringApplication.run(DuridApplication.class, args);
    }

}
